home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJSRC106.ARJ / BINUTILS.DIF < prev    next >
Text File  |  1991-07-20  |  15KB  |  651 lines

  1. diff +context=3 obinutil/aoutenca.h binutils/aoutenca.h
  2. *** obinutil/aoutenca.h    Sun Mar 24 18:16:00 1991
  3. --- binutils/aoutenca.h    Thu Mar  7 00:11:52 1991
  4. ***************
  5. *** 37,43 ****
  6. --- 37,47 ----
  7.   #if !defined (A_OUT_ENCAP_H)
  8.   #define A_OUT_ENCAP_H 1
  9.   
  10. + #ifdef GNUDOS
  11. + #include "aoutgnu.h"
  12. + #else
  13.   #include "a.out.gnu.h"
  14. + #endif
  15.   
  16.   #define N_FLAGS_COFF_ENCAPSULATE 0x20 /* coff header precedes bsd header */
  17.   
  18. diff +context=3 obinutil/ar.c binutils/ar.c
  19. *** obinutil/ar.c    Sun Mar 24 18:16:00 1991
  20. --- binutils/ar.c    Thu Mar  7 00:11:52 1991
  21. ***************
  22. *** 27,37 ****
  23. --- 27,45 ----
  24.   
  25.   #ifdef A_OUT
  26.   #ifdef COFF_ENCAPSULATE
  27. + #ifdef GNUDOS
  28. + #include "aoutencap.h"
  29. + #else
  30.   #include "a.out.encap.h"
  31. + #endif
  32.   #else
  33. + #ifdef GNUDOS
  34. + #include <aout.h>
  35. + #else
  36.   #include <a.out.h>
  37.   #endif
  38.   #endif
  39. + #endif
  40.   
  41.   #ifdef MACH_O
  42.   #ifndef A_OUT
  43. ***************
  44. *** 284,289 ****
  45. --- 292,301 ----
  46.   {
  47.     int i;
  48.   
  49. + #ifdef GNUDOS
  50. +   _fmode = O_BINARY; /* set default file type */
  51. + #endif
  52.     operation = 0;
  53.     verbose = 0;
  54.     newer_only = 0;
  55. ***************
  56. *** 1956,1962 ****
  57. --- 1968,1976 ----
  58.   xmalloc (size)
  59.        unsigned int size;
  60.   {
  61. + #ifndef GNUDOS
  62.     extern char *malloc ();
  63. + #endif
  64.     char *result = malloc (size);
  65.     if (result == 0)
  66.       fatal ("virtual memory exhausted", 0);
  67. ***************
  68. *** 1968,1974 ****
  69. --- 1982,1990 ----
  70.        char *ptr;
  71.        unsigned int size;
  72.   {
  73. + #ifndef GNUDOS
  74.     extern char *realloc ();
  75. + #endif
  76.     char *result = realloc (ptr, size);
  77.     if (result == 0)
  78.       fatal ("virtual memory exhausted");
  79. diff +context=3 obinutil/ld.c binutils/ld.c
  80. *** obinutil/ld.c    Sun Mar 24 18:16:04 1991
  81. --- binutils/ld.c    Thu Mar  7 00:11:54 1991
  82. ***************
  83. *** 17,22 ****
  84. --- 17,26 ----
  85.   
  86.   /* Written by Richard Stallman with some help from Eric Albert.
  87.      Set, indirect, and warning symbol features added by Randy Smith.  */
  88. + #ifdef GNUDOS
  89. + #define TARGET -1
  90. + #endif
  91.      
  92.   /* Define how to initialize system-dependent header fields.  */
  93.   #ifdef sun
  94. ***************
  95. *** 51,60 ****
  96. --- 55,72 ----
  97.   #endif
  98.   
  99.   #ifdef COFF_ENCAPSULATE
  100. + #ifdef GNUDOS
  101. + #include "aoutencap.h"
  102. + #else
  103.   #include "a.out.encap.h"
  104. + #endif
  105. + #else
  106. + #ifdef GNUDOS
  107. + #include <aout.h>
  108.   #else
  109.   #include <a.out.h>
  110.   #endif
  111. + #endif
  112.   
  113.   #ifndef N_SET_MAGIC
  114.   #define N_SET_MAGIC(exec, val)  ((exec).a_magic = val)
  115. ***************
  116. *** 552,558 ****
  117. --- 564,574 ----
  118.   extern char *cplus_demangle ();
  119.   
  120.   /* Demangler function to use. */
  121. + #ifdef GNUDOS
  122. + char *(*demangler)() = cplus_demangle;
  123. + #else
  124.   char *(*demangler)() = NULL;
  125. + #endif
  126.   
  127.   /* Number of buckets in symbol hash table */
  128.   #define    TABSIZE    1009
  129. ***************
  130. *** 885,890 ****
  131. --- 901,907 ----
  132.   struct glosym **cmdline_references;
  133.   int cl_refs_allocated;
  134.   
  135. + #ifndef GNUDOS
  136.   void bcopy (), bzero ();
  137.   int malloc (), realloc ();
  138.   #ifndef alloca
  139. ***************
  140. *** 891,896 ****
  141. --- 908,914 ----
  142.   int alloca ();
  143.   #endif
  144.   int free ();
  145. + #endif
  146.   
  147.   int xmalloc ();
  148.   int xrealloc ();
  149. ***************
  150. *** 939,944 ****
  151. --- 957,966 ----
  152.     }
  153.   #endif /* RLIMIT_STACK */
  154.   
  155. + #ifdef GNUDOS
  156. +   _fmode = O_BINARY; /* set default file type */
  157. + #endif
  158.     page_size = getpagesize ();
  159.     progname = argv[0];
  160.   
  161. ***************
  162. *** 1206,1211 ****
  163. --- 1228,1241 ----
  164.     /* Append the standard search directories to the user-specified ones.  */
  165.     {
  166.       int n = sizeof standard_search_dirs / sizeof standard_search_dirs[0];
  167. + #ifdef GNUDOS
  168. +     extern char *getenv();
  169. +     int libcnt;
  170. +     char *lib_env = getenv("GCCLIB");
  171. +     if (lib_env)
  172. +       for (libcnt = 0; libcnt < n; libcnt++)
  173. +         standard_search_dirs[libcnt] = lib_env;
  174. + #endif
  175.       n_search_dirs += n;
  176.       search_dirs
  177.         = (char **) xrealloc (search_dirs, n_search_dirs * sizeof (char *));
  178. ***************
  179. *** 2128,2134 ****
  180. --- 2158,2168 ----
  181.     for (namelen = 0;
  182.          namelen < sizeof hdr1.ar_name
  183.          && hdr1.ar_name[namelen] != 0 && hdr1.ar_name[namelen] != ' '
  184. + #ifdef GNUDOS
  185. +     ;
  186. + #else
  187.          && hdr1.ar_name[namelen] != '/';
  188. + #endif
  189.          namelen++);
  190.   
  191.     name = (char *) xmalloc (namelen+1);
  192. ***************
  193. *** 3367,3372 ****
  194. --- 3401,3410 ----
  195.     if (entry_symbol == 0)
  196.       entry_symbol = getsym("start");
  197.   #endif
  198. + #ifdef GNUDOS
  199. +   if (entry_symbol == 0)
  200. +     entry_symbol = getsym("start");
  201. + #endif
  202.     outheader.a_data = data_size;
  203.     outheader.a_bss = bss_size;
  204.     outheader.a_entry = (entry_symbol ? entry_symbol->value
  205. ***************
  206. *** 4735,4740 ****
  207. --- 4773,4779 ----
  208.   }
  209.   
  210.   #ifdef USG
  211. + #ifndef GNUDOS
  212.   
  213.   void
  214.   bzero (p, n)
  215. ***************
  216. *** 4755,4760 ****
  217. --- 4794,4800 ----
  218.     return (4096);
  219.   }
  220.   
  221. + #endif
  222.   #endif
  223.   
  224.   #if TARGET == SUN4
  225. diff +context=3 obinutil/makefile binutils/makefile
  226. *** obinutil/makefile    Sun Mar 24 18:16:04 1991
  227. --- binutils/makefile    Thu Mar  7 00:11:54 1991
  228. ***************
  229. *** 22,35 ****
  230.   GNUCC = gcc -O
  231.   bindir=/usr/local/bin
  232.   
  233.   # for BSD systems
  234. ! CFLAGS = -g
  235.   # Don't add robotussin; it won't compile on BSD or GNU systems.
  236.   # objdump is not here because it (at least used to) not compile
  237.   # on most systems (trouble with N_DATADDR).  I've fixed some of
  238.   # those problems, though.
  239. ! PROGS = $(archpfx)gprof $(archpfx)ld $(archpfx)size \
  240. !         $(archpfx)nm $(archpfx)strip $(archpfx)ar $(archpfx)ranlib
  241.   
  242.   # for USG systems using COFF_ENCAPSULATE
  243.   # also, you will want to make the target libc.a (but it takes a long time)
  244. --- 22,42 ----
  245.   GNUCC = gcc -O
  246.   bindir=/usr/local/bin
  247.   
  248. + # GNUDOS: use these
  249. + CFLAGS = -O -DGNUDOS
  250. + PROGS = ld size nm strip ar objdump gprof
  251. + CC = gcc
  252. + .c.o:
  253. +     $(CC) $(CFLAGS) -c $*.c
  254.   # for BSD systems
  255. ! #CFLAGS = -g
  256.   # Don't add robotussin; it won't compile on BSD or GNU systems.
  257.   # objdump is not here because it (at least used to) not compile
  258.   # on most systems (trouble with N_DATADDR).  I've fixed some of
  259.   # those problems, though.
  260. ! #PROGS = $(archpfx)gprof $(archpfx)ld $(archpfx)size \
  261. ! #        $(archpfx)nm $(archpfx)strip $(archpfx)ar $(archpfx)ranlib
  262.   
  263.   # for USG systems using COFF_ENCAPSULATE
  264.   # also, you will want to make the target libc.a (but it takes a long time)
  265. ***************
  266. *** 74,80 ****
  267.   # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might 
  268.   # fail unnecessarily.  I've also seen some unix malloc's fail, even when
  269.   # there is enough memory.  So use the new GNU malloc.
  270. ! MALLOC = $(archpfx)gmalloc.o
  271.   
  272.   GNU_GETOPT = $(archpfx)getopt.o
  273.   GNU_GETOPT_LONG = $(archpfx)getopt.o $(archpfx)getopt1.o
  274. --- 81,88 ----
  275.   # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might 
  276.   # fail unnecessarily.  I've also seen some unix malloc's fail, even when
  277.   # there is enough memory.  So use the new GNU malloc.
  278. ! # GNUDOS: we already have it
  279. ! # MALLOC = $(archpfx)gmalloc.o
  280.   
  281.   GNU_GETOPT = $(archpfx)getopt.o
  282.   GNU_GETOPT_LONG = $(archpfx)getopt.o $(archpfx)getopt1.o
  283. ***************
  284. *** 115,121 ****
  285.   $(archpfx)ranlib.o: ranlib.c
  286.       $(CC) -c $(CFLAGS) -DAR_PROG=\"$(bindir)/ar\" ranlib.c $(OUTPUT_OPTION)
  287.   
  288. ! $(archpfx)objdump: $(archpfx)objdump.o $(GNU_GETOPT_LONG) a.out.gnu.h
  289.       $(CC) $(CFLAGS) -o $(archpfx)objdump $(archpfx)objdump.o \
  290.           $(GNU_GETOPT_LONG) $(LIBS)
  291.   
  292. --- 123,129 ----
  293.   $(archpfx)ranlib.o: ranlib.c
  294.       $(CC) -c $(CFLAGS) -DAR_PROG=\"$(bindir)/ar\" ranlib.c $(OUTPUT_OPTION)
  295.   
  296. ! $(archpfx)objdump: $(archpfx)objdump.o $(GNU_GETOPT_LONG) aoutgnu.h
  297.       $(CC) $(CFLAGS) -o $(archpfx)objdump $(archpfx)objdump.o \
  298.           $(GNU_GETOPT_LONG) $(LIBS)
  299.   
  300. diff +context=3 obinutil/nm.c binutils/nm.c
  301. *** obinutil/nm.c    Sun Mar 24 18:16:04 1991
  302. --- binutils/nm.c    Thu Mar  7 00:11:54 1991
  303. ***************
  304. *** 27,38 ****
  305. --- 27,46 ----
  306.   
  307.   #ifdef A_OUT
  308.   #ifdef COFF_ENCAPSULATE
  309. + #ifdef GNUDOS
  310. + #include "aoutencap.h"
  311. + #else
  312.   #include "a.out.encap.h"
  313. + #endif
  314.   #else
  315.   /* On native BSD systems, use the system's own a.out.h.  */
  316. + #ifdef GNUDOS
  317. + #include <aout.h>
  318. + #else
  319.   #include <a.out.h>
  320.   #endif
  321.   #endif
  322. + #endif
  323.   
  324.   #ifdef MACH_O
  325.   #ifndef A_OUT
  326. ***************
  327. *** 77,83 ****
  328. --- 85,93 ----
  329.   #endif
  330.   #endif
  331.   
  332. + #ifndef GNUDOS
  333.   char *malloc (), *realloc ();
  334. + #endif
  335.   
  336.   char *xmalloc (), *xrealloc ();
  337.   
  338. ***************
  339. *** 261,266 ****
  340. --- 271,280 ----
  341.         {NULL, 0, NULL, 0}
  342.       };
  343.   
  344. + #ifdef GNUDOS
  345. +   _fmode = O_BINARY; /* set default file type */
  346. + #endif
  347.     program_name = argv[0];
  348.   
  349.     number_of_files = 0;
  350. ***************
  351. *** 408,415 ****
  352. --- 422,433 ----
  353.       {
  354.         for (namelen = 0; ; namelen++)
  355.       if (hdr1.ar_name[namelen] == 0 || hdr1.ar_name[namelen] == ' '
  356. + #ifdef GNUDOS
  357. +             )
  358. + #else
  359.           /* Some systems use a slash?  Strange.  */
  360.           || hdr1.ar_name[namelen] == '/')
  361. + #endif
  362.         break;
  363.   
  364.         name = (char *) xmalloc (namelen+1);
  365. diff +context=3 obinutil/objdump.c binutils/objdump.c
  366. *** obinutil/objdump.c    Sun Mar 24 18:16:04 1991
  367. --- binutils/objdump.c    Thu Mar  7 00:11:54 1991
  368. ***************
  369. *** 24,42 ****
  370.   #include <stdio.h>
  371.   #include "getopt.h"
  372.   
  373.   #ifndef COFF_ENCAPSULATE
  374.   #include <a.out.h>
  375.   /* Tell a.out.gnu.h not to try to redefine some things.  */
  376. - #define __STRUCT_EXEC_OVERRIDE__
  377.   #define N_NLIST_DECLARED
  378.   #define N_RELOCATION_INFO_DECLARED
  379.   #define N_MAGIC(exec) ((exec).a_magic)
  380.   #include "a.out.gnu.h"
  381.   #else
  382.   #include "a.out.encap.h"
  383.   #endif
  384.   
  385.   char *malloc();
  386.   char *xmalloc();
  387.   int nsyms;
  388.   struct nlist *symtbl;
  389. --- 24,62 ----
  390.   #include <stdio.h>
  391.   #include "getopt.h"
  392.   
  393. + #ifdef GNUDOS
  394. + #include <sys/file.h>
  395. + #endif
  396.   #ifndef COFF_ENCAPSULATE
  397. + #ifdef GNUDOS
  398. + #include <aout.h>
  399. + #else
  400.   #include <a.out.h>
  401. + #endif
  402.   /* Tell a.out.gnu.h not to try to redefine some things.  */
  403.   #define N_NLIST_DECLARED
  404.   #define N_RELOCATION_INFO_DECLARED
  405. + #ifndef GNUDOS
  406. + #define __STRUCT_EXEC_OVERRIDE__
  407.   #define N_MAGIC(exec) ((exec).a_magic)
  408. + #endif
  409. + #ifdef GNUDOS
  410. + #include "aoutgnu.h"
  411. + #else
  412.   #include "a.out.gnu.h"
  413. + #endif
  414.   #else
  415. + #ifdef GNUDOS
  416. + #include "aoutencap.h"
  417. + #else
  418.   #include "a.out.encap.h"
  419.   #endif
  420. + #endif
  421.   
  422. + #ifndef GNUDOS
  423.   char *malloc();
  424. + #endif
  425.   char *xmalloc();
  426.   int nsyms;
  427.   struct nlist *symtbl;
  428. ***************
  429. *** 132,137 ****
  430. --- 152,161 ----
  431.           {"header", 0, &hflag, 1},
  432.           {NULL, 0, NULL, 0}
  433.         };
  434. + #ifdef GNUDOS
  435. +     _fmode = O_BINARY; /* set default file type */
  436. + #endif
  437.   
  438.       page_size = getpagesize ();
  439.   
  440. diff +context=3 obinutil/size.c binutils/size.c
  441. *** obinutil/size.c    Sun Mar 24 18:16:04 1991
  442. --- binutils/size.c    Thu Mar  7 00:11:54 1991
  443. ***************
  444. *** 26,37 ****
  445. --- 26,45 ----
  446.   
  447.   #ifdef A_OUT
  448.   #ifdef COFF_ENCAPSULATE
  449. + #ifdef GNUDOS
  450. + #include "aoutencap.h"
  451. + #else
  452.   #include "a.out.encap.h"
  453. + #endif
  454.   #else
  455.   /* On native BSD systems, use the system's own a.out.h.  */
  456. + #ifdef GNUDOS
  457. + #include <aout.h>
  458. + #else
  459.   #include <a.out.h>
  460.   #endif
  461.   #endif
  462. + #endif
  463.   
  464.   #ifdef MACH_O
  465.   #include <sys/loader.h>
  466. ***************
  467. *** 61,67 ****
  468. --- 69,77 ----
  469.   
  470.   int member_offset;
  471.   
  472. + #ifndef GNUDOS
  473.   char *malloc ();
  474. + #endif
  475.   
  476.   void do_one_file (), do_one_rel_file ();
  477.   char *xmalloc ();
  478. ***************
  479. *** 72,77 ****
  480. --- 82,91 ----
  481.        int argc;
  482.   {
  483.     int i;
  484. + #ifdef GNUDOS
  485. +   _fmode = O_BINARY; /* set default file type */
  486. + #endif
  487.   
  488.     number_of_files = argc - 1;
  489.   
  490. diff +context=3 obinutil/strip.c binutils/strip.c
  491. *** obinutil/strip.c    Sun Mar 24 18:16:06 1991
  492. --- binutils/strip.c    Thu Mar  7 00:11:56 1991
  493. ***************
  494. *** 35,46 ****
  495. --- 35,54 ----
  496.   
  497.   #ifdef A_OUT
  498.   #ifdef COFF_ENCAPSULATE
  499. + #ifdef GNUDOS
  500. + #include "aoutencap.h"
  501. + #else
  502.   #include "a.out.encap.h"
  503. + #endif
  504.   #else
  505.   /* On native BSD systems, use the system's own a.out.h.  */
  506. + #ifdef GNUDOS
  507. + #include <aout.h>
  508. + #else
  509.   #include <a.out.h>
  510.   #endif
  511.   #endif
  512. + #endif
  513.   
  514.   #ifdef MACH_O
  515.   #ifndef A_OUT
  516. ***************
  517. *** 138,144 ****
  518. --- 146,154 ----
  519.   /* 1 => discard locals starting with L; 2 => discard all locals */
  520.   int discard_locals;
  521.   
  522. + #ifndef GNUDOS
  523.   char *malloc ();
  524. + #endif
  525.   
  526.   void strip_file ();
  527.   int file_open ();
  528. ***************
  529. *** 169,174 ****
  530. --- 179,188 ----
  531.     struct file_entry *p;
  532.     int i;
  533.   
  534. + #ifdef GNUDOS
  535. +   _fmode = O_BINARY; /* set default file type */
  536. + #endif
  537.     strip_symbols = 0;   /* default is to strip everything.  */
  538.     discard_locals = 0;
  539.   
  540. ***************
  541. *** 287,294 ****
  542. --- 301,310 ----
  543.       signal (SIGTERM, SIG_DFL);
  544.   
  545.     /* Handle any signal that came in while they were deferred.  */
  546. + #ifndef GNUDOS
  547.     if (delayed_signal)
  548.       kill (getpid (), delayed_signal);
  549. + #endif
  550.   }
  551.   
  552.   /** Convenient functions for operating on one or all files being processed.  */
  553. *** obinutils/gprof.c    Fri Jul 19 18:28:48 1991
  554. --- binutils/gprof.c    Sat Jul 20 10:11:34 1991
  555. ***************
  556. *** 47,55 ****
  557. --- 47,59 ----
  558.   #ifdef COFF_ENCAPSULATE
  559.   #include "a.out.encap.h"
  560.   #else
  561. + #ifdef GNUDOS
  562. + #include <aout.h>
  563. + #else
  564.   #include <a.out.h>
  565.   #endif
  566.   #endif
  567. + #endif
  568.   
  569.   #ifdef MACH_O
  570.   #ifndef A_OUT
  571. ***************
  572. *** 666,671 ****
  573. --- 670,676 ----
  574.   void    qsort EXT4(void *, size_t, size_t, int (*)(const void *, const void *));
  575.   #endif
  576.   
  577. + #ifndef GNUDOS
  578.   void    exit EXT1(int);
  579.   
  580.   int    strcmp EXT2(const char *, const char *);
  581. ***************
  582. *** 686,691 ****
  583. --- 691,698 ----
  584.   int    vfprintf EXT3(FILE *, const char *, va_list);
  585.   #endif
  586.   
  587. + #endif
  588.   void dbgprintf EXT1N(char *);
  589.   void dumpsyms EXT0();
  590.   void dumpfuns EXT0();
  591. ***************
  592. *** 797,803 ****
  593. --- 804,814 ----
  594.       exec_file_name=OBJ_NAM;
  595.   
  596.     /* Open the a.out file, and read in selected portions */
  597. + #ifdef GNUDOS
  598. +   fp=ck_fopen (exec_file_name, "rb");
  599. + #else
  600.     fp=ck_fopen (exec_file_name, "r");
  601. + #endif
  602.   
  603.     /* Make sure its really an a.out file.  If it isn't yell and scream
  604.        and stamp our feet. */
  605. ***************
  606. *** 2205,2211 ****
  607. --- 2216,2226 ----
  608.   
  609.     PRINT_OBNOXIOUS_DEBUG_MESSAGE (DB_GFILE, ("gmon from `%s'", name));
  610.   
  611. + #ifdef GNUDOS
  612. +   fp=ck_fopen (name, "rb");
  613. + #else
  614.     fp=ck_fopen (name, "r");
  615. + #endif
  616.   
  617.     /* Read in the gmon file header and check that histogram is
  618.        compatible with the other gmon files already read.  */
  619. ***************
  620. *** 2306,2311 ****
  621. --- 2321,2329 ----
  622.     long    ret;
  623.     FILE    *fp;
  624.   
  625. + #ifdef GNUDOS
  626. +   ret = 18;
  627. + #else
  628.   #ifdef USG
  629.   #include <sys/types.h>
  630.   #include <sys/param.h>
  631. ***************
  632. *** 2319,2324 ****
  633. --- 2337,2343 ----
  634.     ck_fseek (fp, (long)nl[0].n_value, 0);
  635.     ck_fread ((void *)&ret, sizeof (ret), 1, fp);
  636.     ck_fclose (fp);
  637. + #endif
  638.   #endif
  639.     PRINT_OBNOXIOUS_DEBUG_MESSAGE (DB_MISC, ("get_ticks ()=%ld", ret));
  640.     return ret;
  641.